package com.misalen.retrofit.converter.request;

import java.io.IOException;

import okhttp3.MediaType;
import okhttp3.RequestBody;

import org.json.JSONObject;

import retrofit2.Converter;

public final class JsonRequestBodyConverter implements
		Converter<JSONObject, RequestBody> {
	private static final MediaType MEDIA_TYPE = MediaType
			.parse("application/json; charset=UTF-8");

	public JsonRequestBodyConverter() {

	}

	@Override
	public RequestBody convert(JSONObject value) throws IOException {
		return RequestBody.create(MEDIA_TYPE, value.toString());
	}

}
